<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/3/18
  Time: 9:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:forEach var="news" items="${list}" varStatus="status">
    <tr <c:if test="${status.count%2==0}">class="color" </c:if>>
        <td><a href="/newsServlet?action=getDetailById&id=${news.id}">${news.title}</a></td>
            <%--对特殊字符转义--%>
        <td><c:out value="${news.author}" escapeXml="true"/></td>
            <%--格式化--%>
        <td><fmt:formatDate value="${news.createDate}" pattern="yyyy-MM-dd"/></td>
        <td>
            <a href="/newsServlet?action=getNewsById&id=${news.id}">编辑</a>&nbsp;&nbsp;&nbsp;
            <a href="/newsServlet?action=delete&id=${news.id}">删除</a>
        </td>
    </tr>
</c:forEach>